unit Main;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.Menus;

type
  TfmMain = class(TForm)
    MMenu: TMainMenu;
    Tanimlar: TMenuItem;
    Raporlar1: TMenuItem;
    Islemler1: TMenuItem;
    Yardim: TMenuItem;
    miSERapor1: TMenuItem;
    miSHYBRapor1: TMenuItem;
    miGarantiRapor1: TMenuItem;
    miFirmaYakala: TMenuItem;
    miFirmaYakalaDetay: TMenuItem;
    N1: TMenuItem;
    miServisListesi: TMenuItem;
    YTSTanmlar1: TMenuItem;
    YTSKartlar1: TMenuItem;
    IthalatciKartlari1: TMenuItem;
    Hareketler1: TMenuItem;
    miTeklifListesi: TMenuItem;
    TeklifHareketTanimlari: TMenuItem;
    procedure miSERapor1Click(Sender: TObject);
    procedure miSHYBRapor1Click(Sender: TObject);
    procedure miGarantiRapor1Click(Sender: TObject);
    procedure FormCreate(Sender: TObject);
    procedure miFirmaYakalaClick(Sender: TObject);
    procedure miFirmaYakalaDetayClick(Sender: TObject);
    procedure miServisListesiClick(Sender: TObject);
    procedure YTSKartlar1Click(Sender: TObject);
    procedure IthalatciKartlari1Click(Sender: TObject);
    procedure miTeklifListesiClick(Sender: TObject);
    procedure TeklifHareketTanimlariClick(Sender: TObject);
  private
    { Private declarations }
    procedure SetParameters;
  public
    { Public declarations }
  end;

var
  fmMain: TfmMain;

implementation

{$R *.dfm}

uses rpTSE, rpSHYB, rpGaranti, Parameters, prSHYBTSECheck, prSHYBTSECheckDetay,
  rpServiceList, entYTS, entIthalatci, entTeklifListesi, entTeklifHareketTanim;

procedure TfmMain.miSHYBRapor1Click(Sender: TObject);
begin
  fmRpSHYB := TfmRpSHYB.Create(Self);
end;

procedure TfmMain.miTeklifListesiClick(Sender: TObject);
begin
  fmTeklifList := TfmTeklifList.Create(Self);
  fmTeklifList.fTableName := 'tbTeklif';
  fmTeklifList.fOpenTable := True;
  fmTeklifList.OnShow(Self);
end;

procedure TfmMain.SetParameters;
begin
  AppDir := ExtractFilePath(Application.ExeName);
  AppSettingsDir := ExtractFilePath(Application.ExeName) + 'Settings\';
  if not DirectoryExists(AppSettingsDir) then
    CreateDir(AppSettingsDir);
end;

procedure TfmMain.TeklifHareketTanimlariClick(Sender: TObject);
begin
  fmTeklifHareketTanim := TfmTeklifHareketTanim.Create(Self);
  fmTeklifHareketTanim.fOpenTable := True;
  fmTeklifHareketTanim.OnShow(Self);
end;

procedure TfmMain.YTSKartlar1Click(Sender: TObject);
begin
  fmYTS := TfmYTS.Create(Self);
  fmYTS.fTableName := 'tbYTS';
  fmYTS.fOpenTable := True;
  fmYTS.OnShow(Self);
end;

procedure TfmMain.FormCreate(Sender: TObject);
begin
  SetParameters;
end;

procedure TfmMain.IthalatciKartlari1Click(Sender: TObject);
begin
  fmIthalatci := TfmIthalatci.Create(Self);
  fmIthalatci.fTableName := 'tbIthalatci';
  fmIthalatci.fOpenTable := True;
  fmIthalatci.OnShow(Self);
end;

procedure TfmMain.miFirmaYakalaClick(Sender: TObject);
begin
  fmSHYBTSECheck := TfmSHYBTSECheck.Create(Self);
end;

procedure TfmMain.miFirmaYakalaDetayClick(Sender: TObject);
begin
  fmSHYBTSECheckDetay := TfmSHYBTSECheckDetay.Create(Self);
end;

procedure TfmMain.miGarantiRapor1Click(Sender: TObject);
begin
  fmRpGaranti := TfmRpGaranti.Create(Self);
end;

procedure TfmMain.miSERapor1Click(Sender: TObject);
begin
  fmRpTSE := TfmRpTSE.Create(Self);
end;

procedure TfmMain.miServisListesiClick(Sender: TObject);
begin
  fmServiceList := TfmServiceList.Create(Self);
end;

end.
